<?php
class HPageDropDownListWidget implements IWidget {
	function render() {
		$o = new HCategoryRobot();
		$o->BuildTreeList('0','ROOT');	
		$a = $o->CategoryList;		
		?>
    <select name="drpCategory" id="drpPageCategory">
    <?php 
    for ($i = 0; $i < count($a); $i++) {    	
      $selected = "";      
      $parent_id = HSql::getFieldById('portal_pages','parent_id', $_GET['id']);      
      if ($parent_id == $a[$i]['NodeID']) $selected = "selected='selected'"; 
    ?>
     	<option value="<?php echo $a[$i]['NodeID']; ?>" <?php echo $selected; ?>>
     		<?php echo $a[$i]['NodeName'];?>
     	</option>
    <?php
    }    
    ?>
    </select>         
		<?php		
	}
}
?>